/**
 * 
 */
package cn.softTank.BpelModelImpl;

import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import cn.softTank.BpelModel.Variable;

/**
 * @author Yuzone (smartzxy@gmail.com)
 *
 */
public class VariableImpl implements Variable {

	private String name;
	private String from;
	private String messageType;
	private String type;
	private String element;
	
	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#getFrom()
	 */
	@Override
	public String getFrom() {
		return from;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#getMessageType()
	 */
	@Override
	public String getMessageType() {
		return messageType;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#getName()
	 */
	@Override
	public String getName() {
		return name;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#getType()
	 */
	@Override
	public String getType() {
		// TODO Auto-generated method stub
		return type;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#getXSDElement()
	 */
	@Override
	public String getXSDElement() {
		// TODO Auto-generated method stub
		return element;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#setFrom(java.lang.String)
	 */
	@Override
	public void setFrom(String value) {
		from=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#setMessageType(java.lang.String)
	 */
	@Override
	public void setMessageType(String value) {
		messageType=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#setName(java.lang.String)
	 */
	@Override
	public void setName(String value) {
		name=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#setType(java.lang.String)
	 */
	@Override
	public void setType(String value) {
		type=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.Variable#setXSDElement(java.lang.String)
	 */
	@Override
	public void setXSDElement(String value) {
		element=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.XmlAdapt#toElement()
	 */
	@Override
	public Element toElement() {
		Element e=DocumentHelper.createElement("variable");
		if(name!=null)
			e.addAttribute("name", name);
		if(messageType!=null)
			e.addAttribute("messageType", messageType);
		if(type!=null)
			e.addAttribute("type", type);
		if(element!=null)
			e.addAttribute("element", element);
		if(from!=null)
			e.addText(from);
		return e;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.XmlAdapt#toXml()
	 */
	@Override
	public String toXml() {
		// TODO Auto-generated method stub
		return null;
	}

}
